<!--
/**************************************************
* @ operatorpasswordview.jsp
*
* Copyright   2005 Hitrust Technology Inc.
* Developed by SDC, Hitrust.
* All Rights Reserved.
*
* Modify History:
*  v1.00, 2006/03/06, owen
*  1) first release
/**************************************************
-->
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ include file="../common.jsp" %>
<%@ taglib uri="/page.util.gs.hitrust.com/taglibs/page" prefix="page"%>
<%

%>
<html>
<head>
<title>查询密码</title>
<META http-equiv=Content-Type content="text/html; charset=UTF-8">
<LINK href="<%=root%>/css/caigouxitong.css" type=text/css rel=stylesheet>
<SCRIPT language="JavaScript" src="<%=root%>/js/common.js"></SCRIPT>
<%
    HashMap tMap = (HashMap)request.getAttribute("OrgAndOper"); 
	ArrayList tGSOperatorOrg = (ArrayList)request.getAttribute("Organization");
	ArrayList tGSOperatorsList = (ArrayList)request.getAttribute("OperatorsList");
	ResultProcess tGSOperator = (ResultProcess)request.getAttribute("Operator");
	ArrayList tList = new ArrayList();
%>
<script>
	var counter;
	function process(){
			if(operatorviewform.operOrgId.value =='00'){		
				return false;
			}
			if(operatorviewform.operId.value =='00'){		
				return false;
			}
			if(operatorviewform.operName.value =='00'){		
				return false;
			}
		operatorviewform.action = "<%=response.encodeURL(root + "/A200402.do")%>";
		operatorviewform.submit();
	}
	
	function change(val){
		
		    var counter="0";			//判断是val是否匹配HashMap中的key值
			<%
			if(tMap != null){
		 	   	Collection tCollection = tMap.keySet();
		        Iterator tIterator = tCollection.iterator();
	  		       while(tIterator.hasNext()){
	  		           String tKey = (String)tIterator.next();
	  		           tList = (ArrayList)tMap.get(tKey);
	  		%>
	  					if(val == '<%=tKey%>'){
	  						counter = "1";
							var listbox = document.getElementById("operId");
							listbox.length = 0;
							var option = new Option();
							option.text = "---全部---";
							option.value = "0000";			
							listbox.options[listbox.length] = option;	  

							var listbox2 = document.getElementById("operName");
							listbox2.length = 0;
							var option2 = new Option();
							option2.text = "---全部---";
							option2.value = "0000";			
							listbox2.options[listbox2.length] = option2;	  
							
							
			<%
							for(int n=0; n<tList.size();n++){
							    GSOperatorBean tOper = (GSOperatorBean)tList.get(n);
							    String id = tOper.getGs_oper_id();
							    String name = tOper.getGs_oper_name();
							    
			%>
							var temp1 = '<%=id%>';
							var temp2 = '<%=id%>';
							var option = new Option();
							option.value = temp1;
							option.text = temp2;
							listbox.options[listbox.length] = option;						
							
							option = new Option();
							option.value='<%=name%>';
							option.text='<%=name%>';
							listbox2.options[listbox2.length] = option;
			
			<%
							}
			%>					  			  											
	  					
	  					}
	  		<%
	  		       }
			}
			
			%>
	    	if(counter == "0"){
		          var listbox = document.getElementById("operId");
		          listbox.length = 0;
		          var option = new Option();
		          option.text = "---全部---";
		          option.value = "0000";
		          
		          listbox.options[listbox.length] = option;  
				var listbox2 = document.getElementById("operName");
				listbox2.length = 0;
				var option2 = new Option();
				option2.text = "---全部---";
				option2.value = "0000";			
				listbox2.options[listbox2.length] = option2;	           
	    	}			
		}
	//}
	function cls()
	{
		document.getElementById("operOrgId").value = "00000";
		change('00000');
		document.getElementById("keyWord").value = "";
	}
</script>
</head>

<body BGCOLOR="#f2f2f2"	text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<form name="operatorviewform" method="get" >
<p><br></p>
<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td height="20"> 
      <table width="100%" border="0" cellspacing="0" cellpadding="1">
        <tr height="20">
          <td height="20" width="1" class="mtxt_black">&nbsp;</td>
          <td height="30" width="758" class="mtxt_black">查询密码</td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td class="bg_line" height="2"></td>
  </tr>
</table>
<br>
<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
	<tr> 
		<td> 
			<table class=bg_table id=tableId	cellspacing=1 cellpadding=0 style="padding-left:5;padding-right:5" width=100% align=center border=0>
				<TR height=20>
					<TD class="bg_column" align=center>所属单位</TD>
					<TD left=right class="bg_row_odd">
						<select name="operOrgId" id="operOrgId" onChange="change(this.value)">				
								<option value="00000">------全部------</option>		
						<%
							String tOperOrgId = request.getParameter("operOrgId");
							if(tGSOperatorOrg != null && tGSOperatorOrg.size() > 0 ){
						%>
											
						<%								    
								for(int i=0; i<tGSOperatorOrg.size(); i++){
									GSOrganizationBean tGSOrganizationBean = (GSOrganizationBean)tGSOperatorOrg.get(i);
									if(tOperOrgId != null && tOperOrgId.equals(tGSOrganizationBean.getGs_org_id())){
						%>
										<option value="<%=tGSOrganizationBean.getGs_org_id()%>" selected>
										<%=tGSOrganizationBean.getGs_org_name()%></option>
						<%				    
									}else{
						%>
										<option value="<%=tGSOrganizationBean.getGs_org_id()%>"><%=tGSOrganizationBean.getGs_org_name()%></option>
						<%			
									}
								}
							}else{
						%>
								<option value="00000" selected>------无------</option>
						<%
							}
						%>
						</select>
					</TD>				
					<TD class="bg_column" align=center>操作员帐号</TD>
					<TD align=left class="bg_row_odd">
<!--					<input type="text" name="operId" value="<%=request.getParameter("operId")==null? "":request.getParameter("operId") %>">-->
					<select name="operId" id="operId" onChange="change2(this.value)">				
						<%
							String tOperId = request.getParameter("operId");
							if(tOperOrgId != null && !tOperOrgId.equals("0000")){
							    ArrayList tOperList  = (ArrayList)tMap.get(tOperOrgId);
							    if(tOperList != null &&tOperList.size() > 0){
						%>
								<option value="0000">------全部------</option>
						<%	        
							    for(int i=0; i<tOperList.size();i++){
							        GSOperatorBean tOper = (GSOperatorBean)tOperList.get(i);
							        if(tOperId != null && tOperId.equals(tOper.getGs_oper_id())){
						%>
										<option value="<%=tOper.getGs_oper_id()%>" selected><%=tOper.getGs_oper_id()%></option>
						<%	            
							        }else{
						%>
										<option value="<%=tOper.getGs_oper_id()%>"><%=tOper.getGs_oper_id()%></option>
						<%		            
							        }	        
							    }
							    }else{
						%>
					    <option value="0000">------全部------</option>								
						<%	        
							    }
							}else{
						%>
						<option value="0000">------全部------</option>						
						<%	    
							}
						%>
					</select>
					</TD>								
				</TR>
				<TR height=20>
					<TD class="bg_column" align=center>操作员姓名</TD>
					<TD align=left class="bg_row_odd">
<!--					<input type="text" name="operName" value="<%=request.getParameter("operName")==null? "":request.getParameter("operName") %>">-->
					<select name="operName">
						<%
							String tOperName = request.getParameter("operName");
						    if(tOperName != null && !tOperName.equals("0000")){
							if(tGSOperatorsList != null && tGSOperatorsList.size() > 0){
						%>
							<option value="0000">------全部------</option>													
						<%
							    for(int i=0; i<tGSOperatorsList.size();i++){
							        GSOperatorBean tOper = (GSOperatorBean)tGSOperatorsList.get(i);
							        if(tOperName != null && tOperName.equals(tOper.getGs_oper_name())){
						%>
										<option value="<%=tOper.getGs_oper_name()%>" selected><%=tOper.getGs_oper_name()%></option>
						<%	            
							        }else{
						%>
										<option value="<%=tOper.getGs_oper_name()%>"><%=tOper.getGs_oper_name()%></option>
						<%		            
							        }	        
							    }
							}else{
						%>
								<option value="0000">------无------</option>
						<%	        
							    }
							}else{
						%>
						<option value="0000">------全部------</option>						
						<%	    
							}
						%>
					</select>
					</TD>
					<TD class="bg_column" align=center>关键字</TD>
					<TD align=left class="bg_row_odd">
						<%
						String tKeyWord = (String)request.getAttribute("s_keyWord");
						if (tKeyWord == null) tKeyWord = request.getParameter("keyWord");
	  	 				if (tKeyWord == null) tKeyWord = "";
						%>
						<input type="text" id="keyWord" name="keyWord" value="<%=tKeyWord%>">&nbsp;&nbsp;(帐号/姓名/职务)
					</td>							
				</TR>
			</table>
		</td>
	</tr>
</table>
<%
int totalRecords = 0;
int defaultPageSize = 10;
if(tGSOperator != null){
            totalRecords = tGSOperator.getRecordsSize();
            %>          
            <page:pager total='<%=totalRecords%>' defaultPageSize='<%=defaultPageSize%>'>
            <%tList = tGSOperator.getDisplayRecords(index.intValue(),pageSize.intValue()); %>
            </page:pager>
            <%} %>
</form>
    <p align="center">  
		<input type="button" class="kuang" width="58" height="24" value="查询" onclick="process()"/>&nbsp;
		<input type="button" class="kuang" width="58" height="24" value="清空" onclick="cls()"/>
    </p>
<%
	
	if(tGSOperator != null){
%>
	<center>
    <table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
		<tr>
			<td>
            <form name='pager' method="post">
            <input type="hidden" name="totalRecords" value="<%=totalRecords%>">
            	<table class=bg_table id=tableId	cellspacing=1 cellpadding=2 width=100% align=center border=0>
                    <tbody> 
                    <tr class="bg_column" height=20> 
                        <td class=top align=middle> 
                        <div align="center" class="txt_content">操作员帐号</div>
						</td>
                        <td class=top align=middle> 
                        <div align="center" class="txt_content">操作员姓名</div>
						</td>
                        <td class=top align=middle> 
                        <div align="center" class="txt_content">操作员职务</div>
						</td>
                        <td class=top align=middle> 
                        <div align="center" class="txt_content">操作员密码</div>
						</td>						
                       
                        <td class=top align=middle> 
                        <div align="center" class="txt_content">所属单位</div>
						</td>
                        <td class=top align=middle> 
                        <div align="center" class="txt_content">操作员有效性</div>
						</td>																																				
					</tr>
					<%
						if(tList != null && tList.size() > 0){
						for(int i=0; i<tList.size(); i++){
							String[] tStr = (String[])tList.get(i);
							String tTempStr="";
							if(i%2==0){
								tTempStr="class=\"bg_row_odd\"";
							}else {
								tTempStr="class=\"bg_row_even\"";
							}
					%>
							<tr <%=tTempStr%> height=20>
								<td class=top align=middle> 
									<div align="center" class="txt_content">
									<%=tStr[0]%>
									</div>
								</td>	
								<td class=top align=middle> 
									<div align="center" class="txt_content">
									<%=tStr[1]%>
									</div>
								</td>								
								<td class=top align=middle> 
									<div align="center" class="txt_content">
									<%=tStr[2]%>
									</div>
								</td>
															
								<td class=top align=middle> 
									<div align="center" class="txt_content">
									<%=tStr[8]%>
									</div>
								</td>								
								<td class=top align=middle> 
									<div align="center" class="txt_content">
									<%=tStr[5]%>
									</div>
								</td>															
								<td class=top align=middle> 
									<div align="center" class="txt_content">
									<%=tStr[6]%>
									</div>
								</td>																
							</tr> 
							
					<%	
							}
					%>
						  <tr class="bg_column" height=20>
						    <td width="960" height="16" colspan="8" align="right">
									<!--导航条-->
						    		<page:navigator type='text' queryForm="operatorviewform"/>
						    </td>
						  
				    <%
						}else{
					%>
							<font color="red">没有符合条件的操作员</font>
					<%
						}
					%>
					</tbody>
				</table>
				</form>					  
			</td>
		</tr>
	</table>
	</center>
	<script language="javascript">
		var val = document.getElementById("operOrgId").value;
		if (val != null && val !='' && val != '00000')
		{
			change(val);
			var operId = "<%=request.getParameter("operId")%>"
			if (operId != null && operId != '')
			{
				document.getElementById("operId").value = operId;
			}
			var operName = "<%=request.getParameter("operName")%>"
			if (operName != null && operName != '')
			{
				document.getElementById("operName").value = operName;
			}
		}
	</script>
<%		
	}
%>
</body>
</html>